package io;

import java.io.*;

public class CopyDemo3 {
    public static void main(String[] args) throws IOException {
        FileOutputStream sos=new FileOutputStream("we.jpg");
        BufferedOutputStream xis=new BufferedOutputStream(sos);
        FileInputStream sis=new FileInputStream("da.jpg");
        BufferedInputStream bis=new BufferedInputStream(sis);
        long start =System.currentTimeMillis();
        int d;
        while((d=bis.read())!=-1){
            xis.write(d);
        }
        long end=System.currentTimeMillis();
        System.out.println("搞定");
        System.out.println("耗时"+(end-start)+"ms");
        xis.close();
        bis.close();
    }
}
